package com.heima.admin.controller.v1;

import com.heima.feign.wemedia.IChannelClient;
import com.heima.model.channel.dtos.ChannelDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmchannelDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author rookie001
 * @creat 2023-06-20-9:39
 */
@RestController
@RequestMapping("/api/v1/channel")
@Slf4j
public class AdChannelController {
    @Autowired
    private IChannelClient iChannelClient;

    @PostMapping("list")
    public ResponseResult list(@RequestBody ChannelDto dto) {
        return iChannelClient.list(dto);
    }

    //频道更改
    @PostMapping("update")
    public ResponseResult update(@RequestBody WmchannelDto dto) {
        return iChannelClient.update(dto);
    }
    //频道新增
    @PostMapping("save")
    public ResponseResult save(@RequestBody WmchannelDto dto) {
        return iChannelClient.save(dto);
    }
}